/**
 * 
 */
package cn.edu.bjtu.alex.rewrite;

import cn.edu.bjtu.alex.rewrite.components.CalcTFIDF;
import cn.edu.bjtu.alex.rewrite.components.CollectWord;
import cn.edu.bjtu.alex.rewrite.components.SelectFeature;
import cn.edu.bjtu.alex.rewrite.components.TrainOutputing;

/**
 * 原来的程序配置太麻烦了,这里简化一下.<br>
 * 
 * 现在是训练阶段的预处理,主要包括:分词(CollectWord),特征词选择(SelectFeature),计算TFIDF(CalcTFIDF),输出向量(TrainOutputing)<br>
 * 也就是上面那4个类把整个过程串起来.
 * 
 * @author alex
 *
 */
public class TrainDriver {
	Context ctx ;
	public TrainDriver(Context ctx){
		this.ctx = ctx;
	}
	public void fit(){
		ctx.reset();
		LifeCycle lc1 = new CollectWord(ctx);
		LifeCycle lc2  = new SelectFeature(ctx);
		LifeCycle lc3 = new CalcTFIDF(ctx);
		LifeCycle lc4 = new TrainOutputing(ctx);
		lc1.fit();
		lc2.fit();
		lc3.fit();
		lc4.fit();
	}
	public static void main(String args[]){

		Context ctx = new Context("E:\\LiYao\\Share\\userData1","E:\\LiYao\\Share\\out1");
		new TrainDriver(ctx).fit();
	}
	
	
}
